import { createRef } from "react";
import { SuspenseComponent } from "@/utils/MyFun";

const routes = [
  {
    name: "Home",
    path: "/",
    element: SuspenseComponent("/home/index.jsx"),
    nodeRef: createRef(null),
  },
  {
    name: "Article",
    path: "/article/:id",
    element: SuspenseComponent("/article/detail/index.jsx"),
    nodeRef: createRef(null),
  },
  {
    name: "Archive",
    path: "/archives",
    element: SuspenseComponent("/discover/archive/index.jsx"),
    nodeRef: createRef(null),
    meta: {
      title: "归档",
    },
  },
  {
    name: "Category",
    path: "/categories",
    element: SuspenseComponent("/discover/category/index.jsx"),
    nodeRef: createRef(null),
    meta: {
      title: "分类",
    },
  },
  {
    name: "CategoryArticles",
    path: "/categories/:categoryId",
    element: SuspenseComponent("/article/list/index.jsx"),
    nodeRef: createRef(null),
    meta: {
      title: "分类",
    },
  },
  {
    name: "Tag",
    path: "/tags",
    element: SuspenseComponent("/discover/tag/index.jsx"),
    nodeRef: createRef(null),
    meta: {
      title: "标签",
    },
  },
  {
    name: "TagArticles",
    path: "/tags/:tagId",
    element: SuspenseComponent("/article/list/index.jsx"),
    nodeRef: createRef(null),
    meta: {
      title: "标签",
    },
  },
  {
    name: "Album",
    path: "/albums",
    element: SuspenseComponent("/entertainment/album/index.jsx"),
    nodeRef: createRef(null),
    meta: {
      title: "相册",
    },
  },
  {
    name: "Link",
    path: "/links",
    element: SuspenseComponent("/link/index.jsx"),
    nodeRef: createRef(null),
    meta: {
      title: "友情链接",
    },
  },
  {
    name: "About",
    path: "/about",
    element: SuspenseComponent("/about/index.jsx"),
    nodeRef: createRef(null),
    meta: {
      title: "关于我",
    },
  },
  {
    name: "MessageBoard",
    path: "/message",
    element: SuspenseComponent("/message/index.jsx"),
    nodeRef: createRef(null),
    meta: {
      title: "留言",
    },
  },
  {
    name: "User",
    path: "/user",
    element: SuspenseComponent("/user/index.jsx"),
    nodeRef: createRef(null),
    meta: {
      title: "个人中心",
    },
  },
];

export default routes;
